#include<iostream>
#include<fstream>
#include<string>
using namespace std;

struct list {
    string course;
    int score;
};

int main()
{
    list list3[3] = { {"Computer",90},{"Mathematics",78},{"English",84} };
    fstream out("s1.txt", ios::out | ios::in);
    int i = sizeof(list) / sizeof(list3[0]);
    while (i--)
    {
        out << list3[i].course << " " << list3[i].score << endl;
    }
    out.seekg(0, out.end);
    int length = out.tellg();
    out.seekg(sizeof(list[1]), out.beg);
    int cur = out.tellg();
    char* msg;
    out.read(msg,length - cur);
    cout << msg << endl;

    return 0;

}
